﻿@model IEnumerable<TimeSheetManagement.Models.Project>

@{
    ViewBag.Title = "Projects";
}

<h2>Projects</h2>

@using (Ajax.BeginForm("Search", "Project", new AjaxOptions{
                    HttpMethod = "GET",
                    InsertionMode = InsertionMode.Replace,
                    UpdateTargetId = "searchResults" }))
{
    <input type="text" name="q" data-autocomplete = "@Url.Action("QuickSearch","Project")" />
    <input type="submit" value="Search" />
}

<p>
    @Html.ActionLink("Create New", "Create")
</p>

@Html.Partial("_ProjectSearchResults", @Model)

<p>Test template jquery</p>

<form method="get" action="@Url.Action("JsonSearch", "Project")" id="searchForm">
    <input type="text" name="q" data-autocomplete = "@Url.Action("QuickSearch","Project")" />
    <input type="submit" value="Search" />
</form>

<table>
    <thead>
        <th>
            Name
        </th>
        <th>
            Informations
        </th>
    </thead>
    <tbody  id="searchResultsTest">

    </tbody>
</table>

<script id="searchTemplate" type="text/x-jquery-tmpl">
    <tr>
        <td>
            ${ProjectName}
        </td>
        <td>
            ${Client}, ${US_PM}
        </td>
    </tr>
</script>